<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/4/2
 * Time: 13:51
 */

namespace common\sources\write\praisekeywords;

use Yii;
use common\models\craftsman\PraiseKeywords;

class PraiseKeywordsAccess implements IPraiseKeywordsAccess
{
    public function addPraiseKeywords($data)
    {
        $connect  = Yii::$app->db;
        $queryBuilder = $connect->queryBuilder;
        $sql = $queryBuilder->batchInsert(PraiseKeywords::tableName(),['bus_id','task_commod_id','value_service_id','word','create_time'],$data);
        return $connect->createCommand($sql)->execute();
    }
    public function delPraisekeywords($value_service_id)
    {
        return PraiseKeywords::deleteAll(['value_service_id' => $value_service_id]);
    }
}